import pickle

list1 = [1, 2, 3, 4, 5]
dict1 = {"a": 1, "b":2}

# 序列化
with open("a.obj", mode="wb") as file:
    pickle.dump(list1, file)

# 反序列化
with open("a.obj", mode="rb") as file2:
    list2 = pickle.load(file2)
print(list2)
